/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * MainMenu.java
 *
 * Created on Nov 1, 2011, 12:13:19 PM
 */
package introse;
import javax.swing.*;
import javax.swing.table.*;
import javax.swing.JOptionPane;
 import java.sql.*;
import java.text.DecimalFormat;
import java.util.Date;
/**
 *
 * @author Owel
 */

public class MainMenu extends javax.swing.JFrame {

    /** Creates new form MainMenu */
  
       private String eid;
    public MainMenu() {
        initComponents();
     
        String data[][] = {{}};
        String col[] = {"EmployeeId","Name","Birthdate","Position","Status"};
        DefaultTableModel model = new DefaultTableModel(data,col);
        jTable8.setModel(model);
        Statement s=null;
        ResultSet rs=null;
         try{
             Connect c = new Connect();
        Connection conn=c.dbConnect();
        s=conn.createStatement();
        String Sqls="SELECT * FROM employee";
        rs=s.executeQuery(Sqls);
       while(rs.next())
       {
          System.out.println(rs.getString("EmployeeId"));
          //rg.getString(column name);
         model.insertRow(jTable8.getRowCount()-1,new Object[]{rs.getString("EmployeeId"),rs.getString("EmployeeName"),rs.getString("Birthdate"),rs.getString("EmployeePosition"),rs.getString("Status")});
           
       }
        conn.close();
        }catch(Exception es){
          System.out.println(es);
            
        }
         String dataSup[][] = {{}};
        String colSup[] = {"SupplierId","SupplierName","Address","ContactNumber","Status"};
        DefaultTableModel modelSup = new DefaultTableModel(dataSup,colSup);
        jTable1.setModel(modelSup);
        s=null;
        rs=null;
         try{
        Connect c = new Connect();
        Connection conn=c.dbConnect();
        s=conn.createStatement();
        String Sqls="SELECT * FROM supplier";
        rs=s.executeQuery(Sqls);
        while(rs.next())
        {
         
          //rg.getString(column name);
         modelSup.insertRow(jTable1.getRowCount()-1,new Object[]{rs.getString("SupplierId"),rs.getString("SupplierName"),rs.getString("Address"),rs.getString("ContactNumber"),rs.getString("Status")});
           
        }
        conn.close();
        }catch(Exception es){
          System.out.println(es);
            
        }
           String dataInv[][] = {{}};
        String colInv[] = {"ProductId","Name","SupplierId","Category","Selling Price","Number Of Stocks","Status"};
        DefaultTableModel modelInv = new DefaultTableModel(dataInv,colInv);
        jTable6.setModel(modelInv);
        s=null;
        rs=null;
         try{
        Connect c = new Connect();
        Connection conn=c.dbConnect();
        s=conn.createStatement();
        String Sqls="SELECT * FROM Inventory";
        rs=s.executeQuery(Sqls);
        
        while(rs.next())
        {
         
          //rg.getString(column name);
         modelInv.insertRow(jTable6.getRowCount()-1,new Object[]{rs.getString("ProductId"),rs.getString("ProductName"),rs.getString("SupplierId"),rs.getString("Category"),rs.getString("SellingPrice"),rs.getString("Quantity"),rs.getString("Status")});
           
        }
        conn.close();
        }catch(Exception es){
          System.out.println(es);
            
        }
         
        
           String dataTS[][] = {{}};
        String colTS[] = {"Date","Time"};
        DefaultTableModel modelTS = new DefaultTableModel(dataTS,colTS);
        jTable3.setModel(modelTS);
        s=null;
        rs=null;
         try{
        Connect c = new Connect();
        Connection conn=c.dbConnect();
        s=conn.createStatement();
        String Sqls="SELECT * FROM transaction";
        rs=s.executeQuery(Sqls);
        while(rs.next())
        {
         
          //rg.getString(column name);
         modelTS.insertRow(jTable3.getRowCount()-1,new Object[]{rs.getString("DateTrans"),rs.getString("TimeTrans")});
           
        }
        conn.close();
        }catch(Exception es){
          System.out.println(es);
            
        }
    }
    public MainMenu(String employeeid)
    {   
        String position;
        position=null;
        eid=employeeid;
        
         initComponents();
        String data[][] = {{}};
        String col[] = {"EmployeeId","Name","Birthdate","Position","Status"};
        DefaultTableModel model = new DefaultTableModel(data,col);
        jTable8.setModel(model);
        Statement s=null;
        ResultSet rs=null;
         try{
         Connect c = new Connect();
        Connection conn=c.dbConnect();
        s=conn.createStatement();
        String Sqls="SELECT * FROM employee";
        rs=s.executeQuery(Sqls);
       while(rs.next())
       {
         
          //rg.getString(column name);
         model.insertRow(jTable8.getRowCount()-1,new Object[]{rs.getString("EmployeeId"),rs.getString("EmployeeName"),rs.getString("Birthdate"),rs.getString("EmployeePosition"),rs.getString("Status")});
           
       }
       conn.close();
         model.removeRow(jTable8.getRowCount()-1);
        }catch(Exception es){
          System.out.println(es);
            
        }
          
         try{
         Connect c = new Connect();
        Connection conn=c.dbConnect();
        s=conn.createStatement();
        String Sqls="SELECT * FROM employee WHERE EmployeeId='"+employeeid+"'";
        rs=s.executeQuery(Sqls);
       while(rs.next())
       {
         
          position=rs.getString("EmployeePosition");
       }
       conn.close();
        
        }catch(Exception es){
          System.out.println(es);
            
        }
        String dataSup[][] = {{}};
        String colSup[] = {"SupplierId","SupplierName","Address","ContactNumber","Status"};
        DefaultTableModel modelSup = new DefaultTableModel(dataSup,colSup);
        jTable1.setModel(modelSup);
        s=null;
        rs=null;
         try{
        Connect c = new Connect();
        Connection conn=c.dbConnect();
        s=conn.createStatement();
        String Sqls="SELECT * FROM supplier";
        rs=s.executeQuery(Sqls);
        while(rs.next())
        {
         
          //rg.getString(column name);
         modelSup.insertRow(jTable1.getRowCount()-1,new Object[]{rs.getString("SupplierId"),rs.getString("SupplierName"),rs.getString("Address"),rs.getString("ContactNumber"),rs.getString("Status")});
           
        }
        conn.close();
         modelSup.removeRow(jTable1.getRowCount()-1);
        }catch(Exception es){
          System.out.println(es);
            
        }
         
           String dataInv[][] = {{}};
        String colInv[] = {"","ProductId","Name","SupplierId","Category","Selling Price","Number Of Stocks","Status"};
        DefaultTableModel modelInv = new DefaultTableModel(dataInv,colInv);
        jTable6.setModel(modelInv);
        s=null;
        rs=null;
        
         try{
        Connect c = new Connect();
        Connection conn=c.dbConnect();
        s=conn.createStatement();
        String Sqls="SELECT * FROM Inventory";
        rs=s.executeQuery(Sqls);
        String stat=null;
        while(rs.next())
        {
         
          //rg.getString(column name);
            if(rs.getInt("Quantity")<=(rs.getInt("PLimit")*.3))
            stat="R";
            else
            stat="";
         modelInv.insertRow(jTable6.getRowCount()-1,new Object[]{stat,rs.getString("ProductId"),rs.getString("ProductName"),rs.getString("SupplierId"),rs.getString("Category"),rs.getString("SellingPrice"),rs.getString("Quantity"),rs.getString("Status")});
            stat="";
        }
        conn.close();
         modelInv.removeRow(jTable6.getRowCount()-1);
         }catch(Exception es){
          System.out.println(es);
            
        }
         TableColumn cols = jTable6.getColumnModel().getColumn(0);
         cols.setPreferredWidth(10);
         
        
          String dataTS[][] = {{}};
        String colTS[] = {"Date","Time"};
        DefaultTableModel modelTS = new DefaultTableModel(dataTS,colTS);
        jTable3.setModel(modelTS);
        s=null;
        rs=null;
         try{
        Connect c = new Connect();
        Connection conn=c.dbConnect();
        s=conn.createStatement();
        String Sqls="SELECT * FROM transaction";
        rs=s.executeQuery(Sqls);
        while(rs.next())
        {
         
          //rg.getString(column name);
         modelTS.insertRow(jTable3.getRowCount()-1,new Object[]{rs.getString("DateTrans"),rs.getString("TimeTrans")});
           
        }
        conn.close();
         modelTS.removeRow(jTable3.getRowCount()-1);
        }catch(Exception es){
          System.out.println(es);
            
        }
         System.out.println(position);
         if(position.equals("Manager"))
         {
             jTabbedPane1.removeTabAt(3);
         }
         else if(position.equals("Employee"))
         {
             jTabbedPane1.removeTabAt(3);
             jTabbedPane1.removeTabAt(1);
             jButton20.setVisible(false);
             jButton21.setVisible(false);
         }
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jButton2 = new javax.swing.JButton();
        jTextField1 = new javax.swing.JTextField();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jLabel13 = new javax.swing.JLabel();
        jComboBox4 = new javax.swing.JComboBox();
        jButton11 = new javax.swing.JButton();
        jButton12 = new javax.swing.JButton();
        jButton13 = new javax.swing.JButton();
        jScrollPane6 = new javax.swing.JScrollPane();
        jTable6 = new javax.swing.JTable();
        jLabel14 = new javax.swing.JLabel();
        jTextField2 = new javax.swing.JTextField();
        jButton14 = new javax.swing.JButton();
        jButton18 = new javax.swing.JButton();
        jButton19 = new javax.swing.JButton();
        jButton20 = new javax.swing.JButton();
        jButton21 = new javax.swing.JButton();
        jButton24 = new javax.swing.JButton();
        jPanel4 = new javax.swing.JPanel();
        jTabbedPane2 = new javax.swing.JTabbedPane();
        jPanel2 = new javax.swing.JPanel();
        jScrollPane3 = new javax.swing.JScrollPane();
        jTable3 = new javax.swing.JTable();
        jLabel3 = new javax.swing.JLabel();
        calendarComboBox1 = new com.imagine.component.calendar.CalendarComboBox();
        jPanel7 = new javax.swing.JPanel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jScrollPane5 = new javax.swing.JScrollPane();
        jTable5 = new javax.swing.JTable();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jButton26 = new javax.swing.JButton();
        jButton27 = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        jButton6 = new javax.swing.JButton();
        jButton7 = new javax.swing.JButton();
        jButton8 = new javax.swing.JButton();
        jComboBox2 = new javax.swing.JComboBox();
        jLabel15 = new javax.swing.JLabel();
        jTextField3 = new javax.swing.JTextField();
        jLabel16 = new javax.swing.JLabel();
        jButton15 = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jButton23 = new javax.swing.JButton();
        jPanel5 = new javax.swing.JPanel();
        jButton1 = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();
        jButton5 = new javax.swing.JButton();
        jComboBox1 = new javax.swing.JComboBox();
        jLabel17 = new javax.swing.JLabel();
        jTextField4 = new javax.swing.JTextField();
        jLabel18 = new javax.swing.JLabel();
        jButton16 = new javax.swing.JButton();
        jScrollPane8 = new javax.swing.JScrollPane();
        jTable8 = new javax.swing.JTable();
        jButton22 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jButton9 = new javax.swing.JButton();
        jButton10 = new javax.swing.JButton();

        jButton2.setText("jButton2");

        jTextField1.setText("jTextField1");

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Main Menu");
        setBackground(new java.awt.Color(255, 255, 255));
        setBounds(new java.awt.Rectangle(250, 50, 0, 0));
        setResizable(false);

        jTabbedPane1.setBackground(new java.awt.Color(255, 255, 255));
        jTabbedPane1.setForeground(new java.awt.Color(51, 51, 51));
        jTabbedPane1.setToolTipText("");
        jTabbedPane1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jTabbedPane1.setFont(new java.awt.Font("Verdana", 0, 14));
        jTabbedPane1.setMinimumSize(new java.awt.Dimension(360, 40));

        jPanel1.setBackground(new java.awt.Color(255, 255, 255));
        jPanel1.setFont(new java.awt.Font("Calibri", 0, 12));
        jPanel1.setPreferredSize(new java.awt.Dimension(681, 520));
        jPanel1.setRequestFocusEnabled(false);

        jLabel13.setFont(new java.awt.Font("Verdana", 0, 14));
        jLabel13.setText(" by:");

        jComboBox4.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "ProductId", "ProductName","Category","SupplierId", "Status" }));

        jButton11.setFont(new java.awt.Font("Verdana", 0, 14));
        jButton11.setText("Edit");
        jButton11.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton11ActionPerformed(evt);
            }
        });

        jButton12.setFont(new java.awt.Font("Verdana", 0, 14));
        jButton12.setText("Restock");
        jButton12.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton12ActionPerformed(evt);
            }
        });

        jButton13.setFont(new java.awt.Font("Verdana", 0, 14));
        jButton13.setText("Add");
        jButton13.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton13ActionPerformed(evt);
            }
        });

        jTable6.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {"1000001", "Safeguard", "1000002", "34", "100"},
                {"1000002", "Max", "1000003", "1", "200"},
                {"1000003", "Chippy", "1000002", "10", "50"},
                {"1000004", "Nova", "1000001", "26", "23"},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null}
            },
            new String [] {
                "Product Id", "Name", "Supplier Id", "Selling Price", "Number of stocks"
            }
        ));
        jTable6.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jScrollPane6.setViewportView(jTable6);
        jTable6.getColumnModel().getColumn(0).setResizable(false);
        jTable6.getColumnModel().getColumn(0).setPreferredWidth(50);
        jTable6.getColumnModel().getColumn(1).setResizable(false);
        jTable6.getColumnModel().getColumn(1).setPreferredWidth(150);
        jTable6.getColumnModel().getColumn(2).setResizable(false);
        jTable6.getColumnModel().getColumn(2).setPreferredWidth(50);
        jTable6.getColumnModel().getColumn(3).setResizable(false);
        jTable6.getColumnModel().getColumn(3).setPreferredWidth(200);
        jTable6.getColumnModel().getColumn(4).setResizable(false);

        jLabel14.setFont(new java.awt.Font("Verdana", 0, 14));
        jLabel14.setText("Search:");

        jButton14.setFont(new java.awt.Font("Verdana", 0, 12));
        jButton14.setText("Search");
        jButton14.setBorder(null);
        jButton14.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton14ActionPerformed(evt);
            }
        });

        jButton18.setFont(new java.awt.Font("Verdana", 0, 14));
        jButton18.setText("Edit");
        jButton18.setBorder(null);
        jButton18.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton18ActionPerformed(evt);
            }
        });

        jButton19.setFont(new java.awt.Font("Verdana", 0, 14));
        jButton19.setText("Set Inactive/Active");
        jButton19.setBorder(null);
        jButton19.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton19ActionPerformed(evt);
            }
        });

        jButton20.setFont(new java.awt.Font("Verdana", 0, 14));
        jButton20.setText("Add");
        jButton20.setBorder(null);
        jButton20.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton20ActionPerformed(evt);
            }
        });

        jButton21.setFont(new java.awt.Font("Verdana", 0, 14));
        jButton21.setText("Restock");
        jButton21.setBorder(null);
        jButton21.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton21ActionPerformed(evt);
            }
        });

        jButton24.setFont(new java.awt.Font("Verdana", 0, 12));
        jButton24.setText("View All");
        jButton24.setBorder(null);
        jButton24.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton24ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 745, Short.MAX_VALUE)
                        .addContainerGap())
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jButton11, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jButton12, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jButton13, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                                .addComponent(jLabel14)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jTextField2, javax.swing.GroupLayout.DEFAULT_SIZE, 101, Short.MAX_VALUE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel13)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jComboBox4, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jButton14, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jButton24, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(51, 51, 51)))
                        .addGap(28, 28, 28))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jButton18, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jButton19, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(10, 10, 10)
                        .addComponent(jButton20, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jButton21, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(105, Short.MAX_VALUE))))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel13)
                        .addComponent(jLabel14)
                        .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jComboBox4, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jButton14, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jButton24, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 436, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jButton20, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jButton21, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jButton19, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton18, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(414, 414, 414)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton11, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton12, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton13, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(26, 26, 26))
        );

        jTabbedPane1.addTab("Inventory", jPanel1);

        jPanel4.setBackground(new java.awt.Color(255, 255, 255));

        jTabbedPane2.setTabPlacement(javax.swing.JTabbedPane.LEFT);
        jTabbedPane2.setFont(new java.awt.Font("Verdana", 0, 12));

        jTable3.setFont(new java.awt.Font("Verdana", 0, 10));
        jTable3.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {"11/18/2011", "18:21", "Customer"},
                {"11/18/2011", "18:13", "Customer"},
                {"11/18/2011", "17:48", "Customer"},
                {"11/18/2011", "17:44", "Customer"},
                {"11/18/2011", "17:32", "Supplier"},
                {"11-18-2011", "17:28", "Customer "},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null}
            },
            new String [] {
                "Date", "Time", "Type"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jTable3.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jTable3.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jTable3MousePressed(evt);
            }
        });
        jScrollPane3.setViewportView(jTable3);
        jTable3.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_INTERVAL_SELECTION);
        jTable3.getColumnModel().getColumn(0).setResizable(false);
        jTable3.getColumnModel().getColumn(1).setResizable(false);
        jTable3.getColumnModel().getColumn(1).setPreferredWidth(35);
        jTable3.getColumnModel().getColumn(2).setResizable(false);

        jLabel3.setFont(new java.awt.Font("Verdana", 0, 12));
        jLabel3.setText("Search Transaction by Date:");

        calendarComboBox1.setBackground(new java.awt.Color(255, 255, 255));
        calendarComboBox1.setDateFormat("MM.dd.yyyy");
        calendarComboBox1.setFont(new java.awt.Font("Verdana", 0, 11));

        jPanel7.setBackground(new java.awt.Color(255, 255, 255));
        jPanel7.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(153, 153, 153)));

        jLabel7.setFont(new java.awt.Font("Verdana", 0, 10));
        jLabel7.setText("Date:");

        jLabel8.setFont(new java.awt.Font("Verdana", 0, 10));
        jLabel8.setText("Time:");

        jLabel9.setFont(new java.awt.Font("Verdana", 0, 10));
        jLabel9.setText("11/18/2011");
        jLabel9.setOpaque(true);

        jLabel10.setFont(new java.awt.Font("Verdana", 0, 10));
        jLabel10.setText("18:21");
        jLabel10.setOpaque(true);

        jTable5.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "ProductID", "ProductName", "Quantity ", "Amount"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, true, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jTable5.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jScrollPane5.setViewportView(jTable5);
        jTable5.getColumnModel().getColumn(0).setResizable(false);
        jTable5.getColumnModel().getColumn(2).setResizable(false);
        jTable5.getColumnModel().getColumn(2).setPreferredWidth(55);
        jTable5.getColumnModel().getColumn(3).setResizable(false);

        jLabel11.setFont(new java.awt.Font("Verdana", 0, 10));
        jLabel11.setText("Total Amount:");

        jLabel12.setBackground(new java.awt.Color(204, 204, 204));
        jLabel12.setFont(new java.awt.Font("Verdana", 0, 10));
        jLabel12.setText("PHP 0.00");
        jLabel12.setOpaque(true);

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGap(83, 83, 83)
                        .addComponent(jLabel7)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 94, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel8)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel11)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 429, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGap(31, 31, 31)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(jLabel8)
                    .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 310, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel11)
                    .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(85, 85, 85))
        );

        jButton26.setFont(new java.awt.Font("Verdana", 0, 12));
        jButton26.setText("Search");
        jButton26.setBorder(null);
        jButton26.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton26ActionPerformed(evt);
            }
        });

        jButton27.setFont(new java.awt.Font("Verdana", 0, 12));
        jButton27.setText("View All");
        jButton27.setBorder(null);
        jButton27.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton27ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 284, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(calendarComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 175, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jButton26, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton27, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(17, 17, 17)
                        .addComponent(jLabel3))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jButton26, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jButton27, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(calendarComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 460, Short.MAX_VALUE)
                    .addComponent(jPanel7, 0, 460, Short.MAX_VALUE))
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 765, Short.MAX_VALUE)
            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTabbedPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 525, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Sales", jPanel4);

        jPanel3.setBackground(new java.awt.Color(255, 255, 255));

        jButton6.setFont(new java.awt.Font("Verdana", 0, 14));
        jButton6.setText("Add");
        jButton6.setBorder(null);
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton6ActionPerformed(evt);
            }
        });

        jButton7.setFont(new java.awt.Font("Verdana", 0, 14));
        jButton7.setText("Set Inactive/Active");
        jButton7.setToolTipText("");
        jButton7.setBorder(null);
        jButton7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton7ActionPerformed(evt);
            }
        });

        jButton8.setFont(new java.awt.Font("Verdana", 0, 14));
        jButton8.setText("Edit");
        jButton8.setBorder(null);
        jButton8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton8ActionPerformed(evt);
            }
        });

        jComboBox2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "SupplierID", "SupplierName", "ContactNumber", "Address","Status" }));

        jLabel15.setFont(new java.awt.Font("Verdana", 0, 14));
        jLabel15.setText("Search:");

        jLabel16.setFont(new java.awt.Font("Verdana", 0, 14));
        jLabel16.setText(" by:");

        jButton15.setFont(new java.awt.Font("Verdana", 0, 12));
        jButton15.setText("Search");
        jButton15.setBorder(null);
        jButton15.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton15ActionPerformed(evt);
            }
        });

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {"1000001", "Peter Moleneuix", "Manila", "12335346"},
                {"1000002", "Job Gates", "Manila", "12455621"},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Supplier ID", "Name", "Address", "Contact Number"
            }
        ));
        jTable1.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jScrollPane1.setViewportView(jTable1);

        jButton23.setFont(new java.awt.Font("Verdana", 0, 12));
        jButton23.setText("View All");
        jButton23.setBorder(null);
        jButton23.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton23ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 745, Short.MAX_VALUE)
                        .addContainerGap())
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel15)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextField3, javax.swing.GroupLayout.DEFAULT_SIZE, 99, Short.MAX_VALUE)
                        .addGap(2, 2, 2)
                        .addComponent(jLabel16)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jButton15, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton23, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(83, 83, 83))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jButton8, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jButton7, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(10, 10, 10)
                        .addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(270, Short.MAX_VALUE))))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel15)
                        .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel16)
                        .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jButton15, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jButton23, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 430, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jButton7, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jButton8, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(26, 26, 26))
        );

        jTabbedPane1.addTab("Supplier", jPanel3);

        jPanel5.setBackground(new java.awt.Color(255, 255, 255));

        jButton1.setFont(new java.awt.Font("Verdana", 0, 14));
        jButton1.setText("Edit");
        jButton1.setBorder(null);
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton4.setFont(new java.awt.Font("Verdana", 0, 14));
        jButton4.setText("Set Inactive/Active");
        jButton4.setBorder(null);
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        jButton5.setFont(new java.awt.Font("Verdana", 0, 14));
        jButton5.setText("Add");
        jButton5.setBorder(null);
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });

        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] {"EmployeeID", "EmployeeName", "Birthdate", "EmployeePosition","Status"}));
        jComboBox1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBox1ActionPerformed(evt);
            }
        });

        jLabel17.setFont(new java.awt.Font("Verdana", 0, 14));
        jLabel17.setText(" by:");

        jLabel18.setFont(new java.awt.Font("Verdana", 0, 14));
        jLabel18.setText("Search:");

        jButton16.setFont(new java.awt.Font("Verdana", 0, 12));
        jButton16.setText("Search");
        jButton16.setBorder(null);
        jButton16.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton16ActionPerformed(evt);
            }
        });

        jTable8.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {"1000001", "Jylland Teodosio", "1000002", "01-01-1994", "Owner"},
                {"1000002", "Jerico Longalong", "1000003", "02-02-1993", "Manager"},
                {"1000003", "Gabriel Pascual", "1000002", "03-03-1994", "Store Helper"},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null}
            },
            new String [] {
                "Employee ID", "Name", "Password", "Birthdate", "Position"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jTable8.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jScrollPane8.setViewportView(jTable8);
        jTable8.getColumnModel().getColumn(0).setResizable(false);
        jTable8.getColumnModel().getColumn(0).setPreferredWidth(50);
        jTable8.getColumnModel().getColumn(1).setResizable(false);
        jTable8.getColumnModel().getColumn(1).setPreferredWidth(150);
        jTable8.getColumnModel().getColumn(2).setResizable(false);
        jTable8.getColumnModel().getColumn(2).setPreferredWidth(50);
        jTable8.getColumnModel().getColumn(3).setResizable(false);
        jTable8.getColumnModel().getColumn(3).setPreferredWidth(200);
        jTable8.getColumnModel().getColumn(4).setResizable(false);

        jButton22.setFont(new java.awt.Font("Verdana", 0, 12));
        jButton22.setText("View All");
        jButton22.setBorder(null);
        jButton22.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton22ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jScrollPane8, javax.swing.GroupLayout.DEFAULT_SIZE, 745, Short.MAX_VALUE)
                        .addContainerGap())
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jLabel18)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextField4, javax.swing.GroupLayout.DEFAULT_SIZE, 99, Short.MAX_VALUE)
                        .addGap(3, 3, 3)
                        .addComponent(jLabel17)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jButton16, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jButton22, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(78, 78, 78))
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap())))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel18)
                        .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel17)
                        .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jButton16, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jButton22, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 435, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(11, 11, 11)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE, 48, Short.MAX_VALUE))
                    .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        jTabbedPane1.addTab("Employee", jPanel5);

        jButton3.setFont(new java.awt.Font("Verdana", 0, 12));
        jButton3.setText("Log Out");
        jButton3.setBorder(null);
        jButton3.setMaximumSize(new java.awt.Dimension(35, 29));
        jButton3.setMinimumSize(new java.awt.Dimension(35, 29));
        jButton3.setPreferredSize(new java.awt.Dimension(35, 29));
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jButton9.setFont(new java.awt.Font("Verdana", 0, 12));
        jButton9.setText("New Transaction");
        jButton9.setBorder(null);
        jButton9.setMaximumSize(new java.awt.Dimension(35, 29));
        jButton9.setMinimumSize(new java.awt.Dimension(35, 29));
        jButton9.setPreferredSize(new java.awt.Dimension(35, 29));
        jButton9.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton9ActionPerformed(evt);
            }
        });

        jButton10.setFont(new java.awt.Font("Verdana", 0, 12));
        jButton10.setText("Change Password");
        jButton10.setBorder(null);
        jButton10.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton10ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(456, 456, 456)
                        .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 153, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jButton10, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 770, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(617, Short.MAX_VALUE)
                .addComponent(jButton9, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jButton9, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 11, Short.MAX_VALUE)
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 585, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton10, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(34, 34, 34))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed
// TODO add your handling code here:
    try{
    joption = new JOptionPane("Set Suplier Inactive");
    int response = JOptionPane.showConfirmDialog(null, "Are you sure you to set this supplier inactive? \nThe supplier can be set active again in the edit menu", "Confirm", JOptionPane.YES_NO_OPTION);
    if (response == JOptionPane.YES_OPTION) {
        int row[]=jTable1.getSelectedRows();
       String msgs=null;
        String supid=jTable1.getValueAt(row[0],0 ).toString();
       String dataSup[][] = {{}};
        String colSup[] = {"SupplierId","SupplierName","Address","ContactNumber","Status"};
        DefaultTableModel model = new DefaultTableModel(dataSup,colSup);
         String status=jTable1.getValueAt(row[0],4 ).toString();
        jTable1.setModel(model);
        Statement s=null;
        ResultSet rs=null;
         try{
             Connect c = new Connect();
        Connection conn=c.dbConnect();
        s=conn.createStatement();
        String Sqls;
        if(status.equals("Active")){
        Sqls="UPDATE supplier SET Status='Inactive' WHERE SupplierId="+supid+"";
        msgs="The supplier has been successfully set inactive";
        }
        else
        {
         Sqls="UPDATE supplier SET Status='Active' WHERE SupplierId="+supid+""; 
         msgs="The supplier has been successfully set active";
        }
            
        s.executeUpdate(Sqls);
        Sqls="SELECT * FROM supplier";
        rs=s.executeQuery(Sqls);
       while(rs.next())
       {
          
            model.insertRow(jTable1.getRowCount()-1,new Object[]{rs.getString("SupplierId"),rs.getString("SupplierName"),rs.getString("Address"),rs.getString("ContactNumber"),rs.getString("Status")});
           
       }
        conn.close();
        }catch(Exception es){
          System.out.println(es);
            
        }
        joption.showMessageDialog(null, msgs, "Set Supplier Inactive", JOptionPane.INFORMATION_MESSAGE);
        
    } 
} catch(Exception e)
    {
      JOptionPane.showMessageDialog (null, "Please select from the table", "Error", JOptionPane.WARNING_MESSAGE);   
    }


}//GEN-LAST:event_jButton7ActionPerformed

private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
// TODO add your handling code here:
    this.setVisible(false);
    new AddEmployee2(eid).setVisible(true);
}//GEN-LAST:event_jButton5ActionPerformed

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
// TODO add your handling code here:
    try{
    int row[]=jTable8.getSelectedRows();
    
    String empid=jTable8.getValueAt(row[0],0 ).toString();
    this.setVisible(false);
    new EditEmployee2(empid,eid).setVisible(true);
    } catch(Exception e)
    {
      JOptionPane.showMessageDialog (null, "Please select from the table", "", JOptionPane.WARNING_MESSAGE);   
    }

}//GEN-LAST:event_jButton1ActionPerformed

private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
// TODO add your handling code here:
    try{
    joption = new JOptionPane("Set Employee Inactive");
    int response = JOptionPane.showConfirmDialog(null, "Are you sure you to set this employee inactive? \nThe employee can be set active again in the edit menu", "Confirm", JOptionPane.YES_NO_OPTION);
    if (response == JOptionPane.YES_OPTION) {
        int row[]=jTable8.getSelectedRows();
       String msg1=null;
        String empid=jTable8.getValueAt(row[0],0 ).toString();
        String data[][] = {{}};
        String col[] = {"EmployeeId","Name","Birthdate","Position","Status"};
        DefaultTableModel model = new DefaultTableModel(data,col);
         String status=jTable8.getValueAt(row[0],4 ).toString();
        jTable8.setModel(model);
        Statement s=null;
        ResultSet rs=null;
         try{
             Connect c = new Connect();
        Connection conn=c.dbConnect();
        s=conn.createStatement();
        String Sqls;
        if(status.equals("Active")){
        Sqls="UPDATE employee SET Status='Inactive' WHERE EmployeeId="+empid+"";
        msg1="The employee has been successfully set inactive";
        }
        else
        {
         Sqls="UPDATE employee SET Status='Active' WHERE EmployeeId="+empid+""; 
         msg1="The employee has been successfully set active";
        }
            
        s.executeUpdate(Sqls);
        Sqls="SELECT * FROM employee";
        rs=s.executeQuery(Sqls);
       while(rs.next())
       {
          
            model.insertRow(jTable8.getRowCount()-1,new Object[]{rs.getString("EmployeeId"),rs.getString("EmployeeName"),rs.getString("Birthdate"),rs.getString("EmployeePosition"),rs.getString("Status")});
           
       }
        conn.close();
        }catch(Exception es){
          System.out.println(es);
            
        }
        
        joption.showMessageDialog(null, msg1, "Set Employee Inactive", JOptionPane.INFORMATION_MESSAGE);
        
    } 
}
    catch(Exception e)
    {
      JOptionPane.showMessageDialog (null, "Please select from the table", "Error", JOptionPane.WARNING_MESSAGE);   
    }
}//GEN-LAST:event_jButton4ActionPerformed

private void jButton9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton9ActionPerformed
// TODO add your handling code here:
    new TransactionsForm(eid).setVisible(true);
    this.setVisible(false);
}//GEN-LAST:event_jButton9ActionPerformed

private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
// TODO add your handling code here:
    this.setVisible(false);
    new AddSupplier(eid).setVisible(true);
}//GEN-LAST:event_jButton6ActionPerformed

private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton8ActionPerformed
// TODO add your handling code here:
      try{  int row[]=jTable1.getSelectedRows();
        String supid=jTable1.getValueAt(row[0],0 ).toString();
        this.setVisible(false);
        new EditSupplier(supid,eid).setVisible(true);
      }
       catch(Exception e)
    {
      JOptionPane.showMessageDialog (null, "Please select from the table", "", JOptionPane.WARNING_MESSAGE);   
    }

}//GEN-LAST:event_jButton8ActionPerformed

private void jButton11ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton11ActionPerformed
// TODO add your handling code here:
  
}//GEN-LAST:event_jButton11ActionPerformed

private void jButton12ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton12ActionPerformed
// TODO add your handling code here:
    new Restock().setVisible(true);
}//GEN-LAST:event_jButton12ActionPerformed

private void jButton13ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton13ActionPerformed
// TODO add your handling code here:
    this.setVisible(false);
    new AddProduct().setVisible(true);
}//GEN-LAST:event_jButton13ActionPerformed

private void jButton10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton10ActionPerformed
   this.setVisible(false);
    new Changepassword(eid).setVisible(true);
   
}//GEN-LAST:event_jButton10ActionPerformed

private void jButton18ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton18ActionPerformed
    try{ 
    int row[]=jTable6.getSelectedRows();
    String ProductId=jTable6.getValueAt(row[0],1 ).toString();
    this.setVisible(false);
    new EditProduct(ProductId,eid).setVisible(true);
    }
    catch(Exception e)
    {
      JOptionPane.showMessageDialog (null, "Please select from the table", "Error", JOptionPane.WARNING_MESSAGE);   
    }
    
}//GEN-LAST:event_jButton18ActionPerformed

private void jButton19ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton19ActionPerformed
// TODO add your handling code here:
    try{
    joption = new JOptionPane("Set Product Inactive");
    int response = JOptionPane.showConfirmDialog(null, "Are you sure you to set this product inactive? \nThe product can be set active again in the edit menu", "Confirm", JOptionPane.YES_NO_OPTION);
    if (response == JOptionPane.YES_OPTION) {
        int row[]=jTable6.getSelectedRows();
       String msgs=null;
       String stat=null;
        String supid=jTable6.getValueAt(row[0],1 ).toString();
         String dataInv[][] = {{}};
        String colInv[] = {"","ProductId","Name","SupplierId","Category","Selling Price","Number Of Stocks","Status"};
        DefaultTableModel modelInv = new DefaultTableModel(dataInv,colInv);
         String status=jTable6.getValueAt(row[0],7).toString();
        jTable6.setModel(modelInv);
        Statement s=null;
        ResultSet rs=null;
         try{
             Connect c = new Connect();
        Connection conn=c.dbConnect();
        s=conn.createStatement();
        String Sqls;
        if(status.equals("Active")){
        Sqls="UPDATE inventory SET Status='Inactive' WHERE ProductId="+supid+"";
        msgs="The product has been successfully set inactive";
        }
        else
        {
         Sqls="UPDATE inventory SET Status='Active' WHERE ProductId="+supid+""; 
         msgs="The product has been successfully set active";
        }
            
        s.executeUpdate(Sqls);
        Sqls="SELECT * FROM inventory";
        rs=s.executeQuery(Sqls);
       while(rs.next())
       {
          //rg.getString(column name);
            if(rs.getInt("Quantity")<=(rs.getInt("PLimit")*.3))
            stat="R";
            else
            stat="";
         modelInv.insertRow(jTable6.getRowCount()-1,new Object[]{stat,rs.getString("ProductId"),rs.getString("ProductName"),rs.getString("SupplierId"),rs.getString("Category"),rs.getString("SellingPrice"),rs.getString("Quantity"),rs.getString("Status")});
            stat="";
           
       }
          modelInv.removeRow(jTable6.getRowCount()-1);
        conn.close();
        }catch(Exception es){
          System.out.println(es);
            
        }
        joption.showMessageDialog(null, msgs, "Set Supplier Inactive", JOptionPane.INFORMATION_MESSAGE);
        
    }
        TableColumn cols = jTable6.getColumnModel().getColumn(0);
         cols.setPreferredWidth(10);
} catch(Exception e)
    {
      JOptionPane.showMessageDialog (null, "Please select from the table", "Error", JOptionPane.WARNING_MESSAGE);   
    }

}//GEN-LAST:event_jButton19ActionPerformed



private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
// TODO add your handling code here:
    
    joption = new JOptionPane("Log Out");
    int response = JOptionPane.showConfirmDialog(null, "Are you sure you want to log out?", "Log Out", JOptionPane.YES_NO_OPTION);
    if (response == JOptionPane.YES_OPTION) {
        new LogInForm().setVisible(true);
        this.setVisible(false);
    } 
}//GEN-LAST:event_jButton3ActionPerformed

private void jButton14ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton14ActionPerformed
// TODO add your handling code here:
     String data[][] = {{}};
     String stat=null;
        String col[] = {"","ProductId","Name","SupplierId","Category","Selling Price","Number Of Stocks","Status"};
        DefaultTableModel model = new DefaultTableModel(data,col);
        jTable6.setModel(model);
        Statement s=null;
        ResultSet rs=null;
         try{
             Connect c = new Connect();
        Connection conn=c.dbConnect();
        s=conn.createStatement();
        String Sqls="SELECT * FROM Inventory WHERE "+jComboBox4.getSelectedItem().toString()+" LIKE '%"+jTextField2.getText()+"%'";
        rs=s.executeQuery(Sqls);
       while(rs.next())
       {
        if(rs.getInt("Quantity")<=(rs.getInt("PLimit")*.3))
            stat="R";
            else
            stat="";
         model.insertRow(jTable6.getRowCount()-1,new Object[]{stat,rs.getString("ProductId"),rs.getString("ProductName"),rs.getString("SupplierId"),rs.getString("Category"),rs.getString("SellingPrice"),rs.getString("Quantity"),rs.getString("Status")});
            stat="";
       }
        conn.close();
         model.removeRow(jTable6.getRowCount()-1);
        }catch(Exception es){
          System.out.println(es);
            
        }
         TableColumn cols = jTable6.getColumnModel().getColumn(0);
         cols.setPreferredWidth(10);
}//GEN-LAST:event_jButton14ActionPerformed

private void jButton20ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton20ActionPerformed
    new AddProduct(eid).setVisible(true);
    this.setVisible(false);
}//GEN-LAST:event_jButton20ActionPerformed

private void jButton21ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton21ActionPerformed
try{
    int row[]=jTable6.getSelectedRows();
    String ProductId=jTable6.getValueAt(row[0],1 ).toString();
    new Restock(ProductId,eid).setVisible(true);
    this.setVisible(false);
} catch(Exception e)
    {
      JOptionPane.showMessageDialog (null, "Please select from the table", "Error", JOptionPane.WARNING_MESSAGE);   
    }

}//GEN-LAST:event_jButton21ActionPerformed

private void jButton16ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton16ActionPerformed
 String data[][] = {{}};
        String col[] = {"EmployeeId","Name","Birthdate","Position","Status"};
        DefaultTableModel model = new DefaultTableModel(data,col);
        jTable8.setModel(model);
        Statement s=null;
        ResultSet rs=null;
         try{
             Connect c = new Connect();
        Connection conn=c.dbConnect();
        s=conn.createStatement();
        String Sqls="SELECT * FROM employee WHERE "+jComboBox1.getSelectedItem().toString()+" LIKE '%"+jTextField4.getText()+"%'";
        rs=s.executeQuery(Sqls);
       while(rs.next())
       {
          //rg.getString(column name);
         model.insertRow(jTable8.getRowCount()-1,new Object[]{rs.getString("EmployeeId"),rs.getString("EmployeeName"),rs.getString("Birthdate"),rs.getString("EmployeePosition"),rs.getString("Status")});
           
       }
        model.removeRow(jTable8.getRowCount()-1);
        conn.close();
        }catch(Exception es){
          System.out.println(es);
            
        }
}//GEN-LAST:event_jButton16ActionPerformed

private void jButton22ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton22ActionPerformed
// TODO add your handling code here:
     String data[][] = {{}};
        String col[] = {"EmployeeId","Name","Birthdate","Position","Status"};
        DefaultTableModel model = new DefaultTableModel(data,col);
        jTable8.setModel(model);
        Statement s=null;
        ResultSet rs=null;
         try{
             Connect c = new Connect();
        Connection conn=c.dbConnect();
        s=conn.createStatement();
        String Sqls="SELECT * FROM employee";
        rs=s.executeQuery(Sqls);
       while(rs.next())
       {
          System.out.println(rs.getString("EmployeeId"));
          //rg.getString(column name);
         model.insertRow(jTable8.getRowCount()-1,new Object[]{rs.getString("EmployeeId"),rs.getString("EmployeeName"),rs.getString("Birthdate"),rs.getString("EmployeePosition"),rs.getString("Status")});
           
       }
        model.removeRow(jTable8.getRowCount()-1);
        conn.close();
        }catch(Exception es){
          System.out.println(es);
            
        }
}//GEN-LAST:event_jButton22ActionPerformed

private void jButton23ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton23ActionPerformed

      String data[][] = {{}};
        String col[] = {"SupplierId","SupplierName","Address","ContactNumber","Status"};
        DefaultTableModel model = new DefaultTableModel(data,col);
        jTable1.setModel(model);
        Statement s=null;
        ResultSet rs=null;
         try{
             Connect c = new Connect();
        Connection conn=c.dbConnect();
        s=conn.createStatement();
        String Sqls="SELECT * FROM supplier";
        rs=s.executeQuery(Sqls);
       while(rs.next())
       {
          System.out.println(rs.getString("SupplierId"));
          //rg.getString(column name);
         model.insertRow(jTable1.getRowCount()-1,new Object[]{rs.getString("SupplierId"),rs.getString("SupplierName"),rs.getString("ContactNumber"),rs.getString("Address"),rs.getString("Status")});
           
       }
        conn.close();
         model.removeRow(jTable1.getRowCount()-1);
        }catch(Exception es){
          System.out.println(es);
            
        }
}//GEN-LAST:event_jButton23ActionPerformed

private void jButton15ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton15ActionPerformed
// TODO add your handling code here:
    String data[][] = {{}};
        String col[] = {"SupplierId","SupplierName","Address","ContactNumber","Status"};
        DefaultTableModel model = new DefaultTableModel(data,col);
        jTable1.setModel(model);
        Statement s=null;
        ResultSet rs=null;
         try{
             Connect c = new Connect();
        Connection conn=c.dbConnect();
        s=conn.createStatement();
        String Sqls="SELECT * FROM supplier WHERE "+jComboBox2.getSelectedItem().toString()+" LIKE '%"+jTextField3.getText()+"%'";
        rs=s.executeQuery(Sqls);
       while(rs.next())
       {
          //rg.getString(column name);
         model.insertRow(jTable1.getRowCount()-1,new Object[]{rs.getString("SupplierId"),rs.getString("SupplierName"),rs.getString("ContactNumber"),rs.getString("Address"),rs.getString("Status")});
           
       }
        model.removeRow(jTable1.getRowCount()-1);
        conn.close();
        }catch(Exception es){
          System.out.println(es);
            
        }
}//GEN-LAST:event_jButton15ActionPerformed

private void jButton24ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton24ActionPerformed
// TODO add your handling code here:
     Statement s=null;
     String stat;
     stat=null;
        ResultSet rs=null;
     String dataInv[][] = {{}};
        String colInv[] = {"","ProductId","Name","SupplierId","Category","Selling Price","Number Of Stocks","Status"};
        DefaultTableModel modelInv = new DefaultTableModel(dataInv,colInv);
        jTable6.setModel(modelInv);
        s=null;
        rs=null;
         try{
        Connect c = new Connect();
        Connection conn=c.dbConnect();
        s=conn.createStatement();
        String Sqls="SELECT * FROM Inventory";
        rs=s.executeQuery(Sqls);
        while(rs.next())
        {
         
         //rg.getString(column name);
            if(rs.getInt("Quantity")<=(rs.getInt("PLimit")*.3))
            stat="R";
            else
            stat="";
         modelInv.insertRow(jTable6.getRowCount()-1,new Object[]{stat,rs.getString("ProductId"),rs.getString("ProductName"),rs.getString("SupplierId"),rs.getString("Category"),rs.getString("SellingPrice"),rs.getString("Quantity"),rs.getString("Status")});
            stat="";
        }
        conn.close();
         modelInv.removeRow(jTable6.getRowCount()-1);
        }catch(Exception es){
          System.out.println(es);
            
        }
         TableColumn cols = jTable6.getColumnModel().getColumn(0);
         cols.setPreferredWidth(10);
}//GEN-LAST:event_jButton24ActionPerformed

private void jButton27ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton27ActionPerformed
// TODO add your handling code here:
     Date asd = calendarComboBox1.getDate();
    java.sql.Date e = new java.sql.Date(asd.getTime());
    String dataTS[][] = {{}};
        String colTS[] = {"Date","Time"};
        DefaultTableModel modelTS = new DefaultTableModel(dataTS,colTS);
        jTable3.setModel(modelTS);
        Statement s;
        ResultSet rs;
        s=null;
        rs=null;
         try{
        Connect c = new Connect();
        Connection conn=c.dbConnect();
        s=conn.createStatement();
        String Sqls="SELECT * FROM transaction";
        rs=s.executeQuery(Sqls);
        while(rs.next())
        {
         
          //rg.getString(column name);
         modelTS.insertRow(jTable3.getRowCount()-1,new Object[]{rs.getString("DateTrans"),rs.getString("TimeTrans")});
           
        }
        conn.close();
         modelTS.removeRow(jTable3.getRowCount()-1);
        }catch(Exception es){
          System.out.println(es);
            
        }
}//GEN-LAST:event_jButton27ActionPerformed

private void jButton26ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton26ActionPerformed
// TODO add your handling code here:
    Date asd = calendarComboBox1.getDate();
    java.sql.Date e = new java.sql.Date(asd.getTime());
    String dataTS[][] = {{}};
        String colTS[] = {"Date","Time"};
        DefaultTableModel modelTS = new DefaultTableModel(dataTS,colTS);
        jTable3.setModel(modelTS);
        Statement s;
        ResultSet rs;
        s=null;
        rs=null;
         try{
        Connect c = new Connect();
        Connection conn=c.dbConnect();
        s=conn.createStatement();
        String Sqls="SELECT * FROM transaction WHERE DateTrans='"+e.toString()+"'";
        rs=s.executeQuery(Sqls);
        while(rs.next())
        {
         
          //rg.getString(column name);
         modelTS.insertRow(jTable3.getRowCount()-1,new Object[]{rs.getString("DateTrans"),rs.getString("TimeTrans")});
           
        }
        conn.close();
         modelTS.removeRow(jTable3.getRowCount()-1);
        }catch(Exception es){
          System.out.println(es);
            
        }
}//GEN-LAST:event_jButton26ActionPerformed

private void jTable3MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable3MousePressed
// TODO add your handling code here:
     int row[]=jTable3.getSelectedRows();
        String date=(jTable3.getValueAt(row[0],0 ).toString());
        String time =(jTable3.getValueAt(row[0],1 ).toString());
       String pid=null;
    Statement s=null;
        ResultSet rs=null;
     String dataInv[][] = {{}};
        String colInv[] = {"ProductId","ProductName","Quantity","Amount"};
        DefaultTableModel modelInv = new DefaultTableModel(dataInv,colInv);
        jTable5.setModel(modelInv);
        jLabel9.setText(date);
        jLabel10.setText(time);
        s=null;
        rs=null;
        Statement s2=null;
        ResultSet rs2=null;
        String transcode=null;
         try{
        Connect c = new Connect();
        Connection conn=c.dbConnect();
        s=conn.createStatement();
        s2=conn.createStatement();
        String Sqls="SELECT * FROM transaction where DateTrans like '"+date+"'AND TimeTrans Like '"+time+"'";
           System.out.println(Sqls);
        rs=s.executeQuery(Sqls);
        while(rs.next())
        {
         
          transcode=rs.getString("TransactionNUmber");
          
        }
    
         Sqls="SELECT * FROM customertransaction where TransactionCode like '"+transcode+"%'";
         rs=s.executeQuery(Sqls);
         while(rs.next()){
                Sqls="SELECT * FROM inventory where ProductId='"+rs.getString("ProductId")+"'";
                rs2=s2.executeQuery(Sqls);
                while(rs2.next())
                    pid=rs2.getString("ProductName");
                 modelInv.insertRow(jTable5.getRowCount()-1,new Object[]{rs.getString("ProductId"),pid,rs.getString("Quantity"),rs.getString("Amount")});
         
             }
         conn.close();
          modelInv.removeRow(jTable5.getRowCount()-1);
        }catch(Exception es){
 
            System.out.println(es);
        }
         int count=jTable5.getRowCount()-1;
         float tamount=0;
         for(int i=0;i<count+1;i++)
         {
             tamount+=Float.parseFloat(jTable5.getValueAt(i,3).toString());
             
         }
         jLabel12.setText("PHP"+tamount+"");
         
       
}//GEN-LAST:event_jTable3MousePressed

private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox1ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jComboBox1ActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(MainMenu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(MainMenu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(MainMenu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(MainMenu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new MainMenu().setVisible(true);
            }
        });
    }
    private JOptionPane joption;
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private com.imagine.component.calendar.CalendarComboBox calendarComboBox1;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton10;
    private javax.swing.JButton jButton11;
    private javax.swing.JButton jButton12;
    private javax.swing.JButton jButton13;
    private javax.swing.JButton jButton14;
    private javax.swing.JButton jButton15;
    private javax.swing.JButton jButton16;
    private javax.swing.JButton jButton18;
    private javax.swing.JButton jButton19;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton20;
    private javax.swing.JButton jButton21;
    private javax.swing.JButton jButton22;
    private javax.swing.JButton jButton23;
    private javax.swing.JButton jButton24;
    private javax.swing.JButton jButton26;
    private javax.swing.JButton jButton27;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton6;
    private javax.swing.JButton jButton7;
    private javax.swing.JButton jButton8;
    private javax.swing.JButton jButton9;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JComboBox jComboBox2;
    private javax.swing.JComboBox jComboBox4;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane8;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTabbedPane jTabbedPane2;
    private javax.swing.JTable jTable1;
    private javax.swing.JTable jTable3;
    private javax.swing.JTable jTable5;
    private javax.swing.JTable jTable6;
    private javax.swing.JTable jTable8;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JTextField jTextField3;
    private javax.swing.JTextField jTextField4;
    // End of variables declaration//GEN-END:variables
}
